---
description: >
  cmus music player essential commands and keybindings.
title: "cmus"
---

<details markdown="1" id="table-of-contents">
<summary>
Table of Contents
</summary>

* TOC
{:toc}
</details>

## Basics

<div markdown="1" class="table">

| Description    | Command        |
|----------------|----------------|
| quit cmus      | `:q`           |
| cancel command | `ESC` or `C-c` |
| auto-complete  | `TAB`          |

</div>

## Navigation

<div markdown="1" class="table">

| Description        | Key Binding |
|--------------------|-------------|
| up                 | `k`         |
| down               | `j`         |
| expand selection   | `SPC`       |
| play selected song | `ENTER`     |

</div>


## Manage Music

Add a directory:

```shell
> :a /path/to/music
```

Clear playlist or library

```shell
> :c
```

Save playlist

```shell
> :save <playlist.pls>
```

Load playlist

```shell
> :load <playlist.pls>
```

Search for \<keyword>

```shell
> /<keyword>ENTER
```

Go to next \<keyword> occurrence

```shell
> n
```


## Views

<div markdown="1" class="table">

| View     | Key Binding |
|----------|-------------|
| Library  | `1`         |
| Playlist | `3`         |
| Queue    | `4`         |
| Explorer | `5`         |
| Settings | `7`         |

</div>

### Library

<div markdown="1" class="table">

| Description               | Key Binding |
|---------------------------|-------------|
| switch tab                | `TAB`       |
| previous track            | `z`         |
| play                      | `x`         |
| pause                     | `c`         |
| stop                      | `v`         |
| next track                | `b`         |
| shuffle                   | `s`         |
| Decrease volume           | `-`         |
| Increase volume           | `+`         |
| add selection to playlist | `y`         |
| queue selection           | `e`         |

</div>

### Rebind Keys

In `Settings` view, we need to scroll up to the keybinding we wish to change.
Hit `Enter` then

```shell
> :bind -f common <key> <action>
```

## Preferences

We set preferences using the formula:

```shell
> :set <option>=<value>
```

<div markdown="1" class="table">

| Description                 | Option                |
|-----------------------------|-----------------------|
| Repeat all                  | `replaygain=1`        |
| Change output plugin        | `output_plugin=oss`   |
| Reshuffle when finished     | `auto_reshuffle=true` |
| Shuffle library or playlist | `shuffle=true`        |
| Use software volume control | `softvol=true`        |

</div>

We can save our preferences to `~/.config/cmus/rc`. For instance, in Linux:

```sh
set output_plugin=alsa
set dsp.alsa.device=default
set mixer.alsa.device=default
set mixer.alsa.channel=Master
set softvol=true
```

## Resources

- `$ man cmus-tutorial`
- `$ man cmus`
- [Cmus @ Arch Linux Wiki](https://wiki.archlinux.org/index.php/Cmus){:rel="nofollow noreferrer noopener"}
- [Extensions & useful scripts](https://github.com/cmus/cmus/wiki){:rel="nofollow noreferrer noopener"}
- [Cmus Themes](https://github.com/cmus/cmus/wiki/themes){:rel="nofollow noreferrer noopener"}
